@extends('layouts/app')

@section('content')
{{-- manage订单管理--}}



    <div class="order-list">
        <input type="hidden" name="_token" value="CBeLcr41KwfsiVWlCZD6U3XtyVuyxhCBhGSMIwWi">        <!-- 容器 -->
        <ul class="nav-tabs list-unstyled row status-list ">
            <li class="pull-left f30"><a href="javascript:;" class="active" data-status="" data-id="#1">全部</a></li>
            <li class="pull-left f30"><a href="javascript:;" data-status="2" data-id="#2">支付成功</a></li>
            <li class="pull-left f30"><a href="javascript:;" data-status="3" data-id="#3">进行中</a></li>
            <li class="pull-left f30"><a href="javascript:;" data-status="4" data-id="#4">已完成</a></li>
            <li class="pull-left f30"><a href="javascript:;" data-status="6" data-id="#5">退款/售后</a></li>
        </ul>
        <ul class="nav-tabs booktl f24">
            <li><a href="javascript:;" data-type="1" class="active" data-id="#book">预订</a></li>
            <li><a href="javascript:;" data-type="0" class="distribution mode" data-id="#delivery">配送</a></li>
            <li><a href="javascript:;" data-type="2" class="distribution" data-id="#queue">排队</a></li>
            <li><a href="javascript:;" data-type="3" data-id="#scan">扫码</a></li>
        </ul>

        {{--提示--}}
        <div class="tab-content ">
            <ul class="data-list f28">
            </ul>
            <div>
                <div class="weui-infinite-scroll hasdata" style="display: none;">
                    <div class="infinite-preloader"></div>
                    <div class="weui-loadmore">
                        <i class="weui-loading"></i>
                        <span class="weui-loadmore__tips">正在加载</span>
                    </div>
                </div>
                <div class="weui-infinite-scroll nodata" style="display: block;">
                    <div class="weui-loadmore weui-loadmore_line">
                        <span class="weui-loadmore__tips">没有更多了</span>
                    </div>
                </div>
            </div>
        </div>



    </div>
    <script>
        var sid = getRequest().id;

        function initPage(type, status) {
            AjaxPage.init({
                url: '/api/shop/allOrders',    //路径
                cElement: '.order-list',    // 滚动容器
                element: '.data-list',    // 列表容器
                type: 'managementh',      //渲染类型
                total: 0,   // 总记录条数
                loading: !1, // 加载状态
                arg: {      // 请求参数
                    page: 1,
                    limit: 8,
                    type: type,
                    shop_id: sid,
                    status: status
                }
            });

        }
        // 初始化
        //一级分类
        var fType = $(".booktl  a.active").attr("data-type");
        //二级分类
        var fStatus = $(".status-list a.active").attr("data-status");
        initPage(fType, fStatus);


        // 一级菜单切换
        $(".status-list a").click(function () {
            var fType = $(".booktl  a.active").attr("data-type");
            var status = $(this).attr("data-status");

            // 在创建数据前先把容器置空
            $('.data-list').html('');

            // 初始化数据
            initPage(fType, status);
        });


        // 二级菜单切换
        $(".booktl  a").click(function () {
            var type = $(this).attr("data-type");
            var fStatus = $(".order-list .nav-tabs a.active").attr("data-status");

            // 在创建数据前先把容器置空
            $('.data-list').html('');

            // 初始化数据

            initPage(type, fStatus);
        });
    </script>


@endsection
@extends('layouts/footer')
